﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Secure/Secure.Master" AutoEventWireup="true" CodeBehind="RawView.aspx.cs" Inherits="Site.Secure.RawView" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <h1>Raw View</h1>
<a>This page lets you view the data in its raw form just like it appears in the database. There are basic data managment tools such as delete and edit avaliable at the end of the page.</a>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2>Raw Data View</h2>
    <p>&nbsp;</p>
    <a>Quick Links<asp:Button ID="Button8" runat="server" Text="Latest" 
        onclick="Button8_Click" /></a>
    <p>&nbsp;</p>
    <h4>There are currently 
        <asp:Label ID="lblCount" runat="server" Text="0"></asp:Label> &nbsp;records</h4>
<div>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" DataSourceID="SqlDataSource1" PageSize="50" 
        onprerender="GridView1_PreRender" AutoGenerateEditButton="True" 
        EnableSortingAndPagingCallbacks="True">
        <Columns>
            <asp:BoundField DataField="Barcode" HeaderText="Barcode" 
                SortExpression="Barcode" />
            <asp:BoundField DataField="SiteID" HeaderText="SiteID" 
                SortExpression="SiteID" />
            <asp:BoundField DataField="SupersCount" HeaderText="SupersCount" 
                SortExpression="SupersCount" />
            <asp:BoundField DataField="Brood" HeaderText="Brood" SortExpression="Brood" />
            <asp:BoundField DataField="FullFrames" HeaderText="FullFrames" 
                SortExpression="FullFrames" />
            <asp:BoundField DataField="Feed" HeaderText="Feed" SortExpression="Feed" />
            <asp:BoundField DataField="Capped" HeaderText="Capped" 
                SortExpression="Capped" />
            <asp:CheckBoxField DataField="Feeding" HeaderText="Feeding" 
                SortExpression="Feeding" />
            <asp:CheckBoxField DataField="Attention" HeaderText="Attention" 
                SortExpression="Attention" />
            <asp:CheckBoxField DataField="Harvest" HeaderText="Harvest" 
                SortExpression="Harvest" />
            <asp:CheckBoxField DataField="Problems" HeaderText="Problems" 
                SortExpression="Problems" />
            <asp:CheckBoxField DataField="Queen" HeaderText="Queen" 
                SortExpression="Queen" />
            <asp:BoundField DataField="GPS" HeaderText="GPS" SortExpression="GPS" />
            <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
            <asp:BoundField DataField="Time" HeaderText="Time" SortExpression="Time" />
            <asp:BoundField DataField="PID" HeaderText="PID" SortExpression="PID" />
            <asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" 
                ReadOnly="True" />
        </Columns>
    </asp:GridView> 
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:csMain %>" 
        SelectCommand="SELECT * FROM [DataTable] ORDER BY [Barcode]" 
        ProviderName="System.Data.SqlClient"></asp:SqlDataSource>
    <br />
</div>
<div>
<div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Image ID="Image1" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
</div>
<h3 class="queryLbl">Query Tools</h3>
<div class="queryDiv">
    <p>
        <asp:Label ID="lblQueryStatus" runat="server"></asp:Label>
    </p>
<a>Find 
    <asp:DropDownList ID="DropDownList1" runat="server">
        <asp:ListItem>Barcode</asp:ListItem>
        <asp:ListItem>SiteID</asp:ListItem>
        <asp:ListItem>SupersCount</asp:ListItem>
        <asp:ListItem>Brood</asp:ListItem>
        <asp:ListItem>FullFrames</asp:ListItem>
        <asp:ListItem>Feed</asp:ListItem>
        <asp:ListItem>Capped</asp:ListItem>
        <asp:ListItem>Feeding</asp:ListItem>
        <asp:ListItem>Attention</asp:ListItem>
        <asp:ListItem>Harvest</asp:ListItem>
    </asp:DropDownList>
 that equals 
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:Button ID="Button4" runat="server" onclick="Button4_Click" Text="Find" />
    </a>
    <br />
    <a>Find <asp:DropDownList ID="DropDownList2" runat="server">
        <asp:ListItem>Problems</asp:ListItem>
    </asp:DropDownList> that equals 
        <asp:DropDownList ID="DropDownList3" runat="server">
            <asp:ListItem>True</asp:ListItem>
            <asp:ListItem>False</asp:ListItem>
    </asp:DropDownList>
    and Month equals
    <asp:DropDownList ID="DropDownList4" runat="server">
        <asp:ListItem>January</asp:ListItem>
    </asp:DropDownList>
    <asp:Button ID="Button5" runat="server" Text="Find" />
    </a>
    <br />
    <a>Find using SQL statment 
        <asp:TextBox ID="TextBox2" runat="server" Enabled="False" Width="170px">SELECT * FROM Database</asp:TextBox>
    <asp:TextBox ID="edtSQL" runat="server" Width="276px"></asp:TextBox>
    <asp:Button ID="Button6" runat="server" onclick="Button6_Click" 
        Text="Execute" />
    </a>
    <br />
    <h3>Data Tools</h3>
    <a>Delete Data Using SQL<asp:TextBox ID="TextBox3" runat="server" Width="467px"></asp:TextBox>
    <asp:Button
        ID="Button7" runat="server" Text="Execute" onclick="Button7_Click"/></a>
</div>
<h3 class="toolsLbl">Tools</h3>
<div class="toolsDiv">
    <a><asp:Button ID="Button1" runat="server" Text="Cleanup" 
        ToolTip="Cleanup Database - Disabled" onclick="Button1_Click" 
        Width="100px" />
    Remove invalid entries from the database and attempt to correct invalid data</a>
    <br />
    
    <a>
        <asp:Button ID="Button2" runat="server" Text="Export" Width="100px" 
        onclick="Button2_Click" />Export 
    database in CSV format</a>
    <br />
    <a>
        <asp:Button ID="Button3" runat="server" Text="Import" 
        onclick="Button3_Click" Width="100px" />Import Data from text format</a>
    <br />
    </div>
</div>
</asp:Content>
